package com.classLoader;

import java.lang.reflect.InvocationTargetException;

/**
 * 测试：类中使用到的类是由哪个加载器先loadClass的
 * 结果：是由加载当前类的加载器先执行loadClass的
 */
public class Test {

    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        MyClassLoaderTest.MyClassLoader msbClassLoader = new MyClassLoaderTest.MyClassLoader("D:\\DownLoadProject\\LearnJVM\\testData\\");
        Class clazz1 = msbClassLoader.loadClass("com.test.LoadTestClass");
        Object o1 = clazz1.newInstance();
        clazz1.getMethod("test").invoke(o1);
    }
}
